package com.swt.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.swt.service.OrderDetailService;
import com.swt.domain.OrderDetail;
import com.swt.mapper.OrderDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 苏
* @description 针对表【yesapi_shopxo_s_order_detail(ShopXO商城-订单详情)】的数据库操作Service实现
* @createDate 2022-05-16 09:40:37
*/
@Service
public class OrderDetailServiceImpl implements OrderDetailService {

    @Autowired
    private OrderDetailMapper DetailMapper;
    @Override
    public List<OrderDetail> selectAllDetail() {
        return DetailMapper.selectList(null);
    }

    @Override
    public int delectDetail(String id) {
        return DetailMapper.deleteById(id);
    }

    @Override
    public int updateDetail(OrderDetail goods) {
        return DetailMapper.updateById(goods);
    }

    @Override
    public int inserDetail(OrderDetail goods) {
        return DetailMapper.insert(goods);
    }

    @Override
    public OrderDetail selectbyidDetail(String id) {
        return DetailMapper.selectById(id);
    }

    @Override
    public Page<OrderDetail> pageDetail(Integer page, Integer start) {
        Page<OrderDetail> userPge = new Page<>(page,start);
        return DetailMapper.selectPage(userPge,null);
    }
}




